#include "QuorumType.h"

namespace QuorumType
{
    QString NameOf(Type i_type)
    {
        QString name;
        switch (i_type)
        {
        case Deacon:
            name = "Deacon";
            break;
        case Teacher:
            name = "Teacher";
            break;
        case Priest:
            name = "Priest";
            break;
        case Retired:
            name = "Retired";
            break;
        }
        return name;
    }
    
    Type ValueOf(QString i_name)
    {
        Type type = Deacon;
        if (i_name.compare("Deacon", Qt::CaseInsensitive) == 0)
            type = Deacon;
        else if (i_name.compare("Teacher", Qt::CaseInsensitive) == 0)
            type = Teacher;
        else if (i_name.compare("Priest", Qt::CaseInsensitive) == 0)
            type = Priest;
        else if (i_name.compare("Retired", Qt::CaseInsensitive) == 0)
            type = Retired;
        
        return type;
    }
    
    Type& operator++(Type& i_type)
    {
		i_type = Type(i_type + 1);
    	return i_type;
    }

    Type operator++(Type& i_type, int)
    {
    	Type rtn = i_type;
    	++i_type;
    	return rtn;
    }

}

